<?php
use kartik\form\ActiveForm;
use yii\bootstrap\Html;
use wodrow\yii2wtools\tools\JsBlock;
use yii\helpers\Url;
use common\Tools;
use fztadmin\modules\rbac\widgets\role_fun_data_rule\RoleFunDataRule;
use wodrow\yii2wtools\tools\Tree;
/**
 * @var \yii\web\View $this
 * @var fztadmin\modules\rbac\models\forms\AdminRole $model
 */
$this->title = "数据规则设置";
$checkedAdminPowers = $model->getCheckedAdminPowers(1);
$powerTree = Tree::list2tree($checkedAdminPowers, null);
?>
    <div>
        <div class="row">
            <div class="col-xs-12">
                <?php $form = ActiveForm::begin(); ?>
                <?=$form->field($model, 'id')->hiddenInput()->label(false) ?>
                <?=RoleFunDataRule::widget(['model' => $model, 'attribute' => 'has_is_selected_data_rules', 'tree_data' => $powerTree]) ?>
                <?php if (!Yii::$app->request->isAjax){ ?>
                    <div class="form-group">
                        <?= Html::submitButton("保存", ['class' => 'btn btn-primary']) ?>
                    </div>
                <?php } ?>
                <?php ActiveForm::end(); ?>
            </div>
        </div>
    </div>
<?php JsBlock::begin(); ?>
    <script>
        $(function (){});
    </script>
<?php JsBlock::end(); ?>